package com.ab.dialog.loadingDialog;

import android.content.Context;
import android.support.v4.app.FragmentManager;

import com.ab.R;
import com.ab.dialog.gifloading.GifLoadingView;
import com.ab.view.dialog.StyledDialog;


/**
 * 描述：
 * 作者：xiaoxing on 17/4/23 22:10
 * 邮箱：2235445233@qq.com
 */
public class LoadingDialogUtil {

    private static LoadingDialog dialog;


    private static GifLoadingView mGifLoadingView;


    public static void showGifdialog(FragmentManager fragmentManager) {

        mGifLoadingView = new GifLoadingView();
        mGifLoadingView.setImageResource(R.raw.loading);
        mGifLoadingView.show(fragmentManager, "Dialog");
    }

    /**
     */
    public static void dismissDialog() {
        if (mGifLoadingView != null) {
            mGifLoadingView.dismiss();
        }
    }

    /**
     * 显示美团进度对话框
     *
     * @param
     */
    public static void showmeidialog(Context context) {
        dialog = new LoadingDialog(context, "正在加载中", R.drawable.frame, LoadingDialog.Type_IMG);
        dialog.show();
    }

//    public static void showGifdialog(Context context) {
//        dialog = new LoadingDialog(context, "", R.raw.loading, LoadingDialog.Type_GIF);
//        dialog.show();
//    }


    /**
     */
//    public static void dismissDialog() {
//        if (dialog != null) {
//            dialog.dismiss();
//        }
//    }
    public static void showStyledDialog() {
        StyledDialog.buildLoading().show();
    }

    public static void dismissStyledDialog() {

        StyledDialog.dismissLoading();
    }
}
